package ru.romannep.pc.chopperbattle;

import java.io.Serializable;
import java.util.ArrayList;


/**
 * Сообщение передаваемое по сети (между сервером и клиентом)
 * 
 */
public class NetworkMessage implements Serializable{
    public MessageType type;
    public String s;
    public ArrayList<ChopperCommands> commands;

    public NetworkMessage(MessageType type, String s) {
        this.type = type;
        this.s = s;
    }

    public NetworkMessage(MessageType type, String s, ArrayList<ChopperCommands> commands) {
        this.type = type;
        this.s = s;
        this.commands = commands;
    }
    public NetworkMessage(NetworkMessage msg){
        type = msg.type;
        s = msg.s;
        if (msg.commands != null) {
            commands = new ArrayList<ChopperCommands>(msg.commands);
        }
    }
    
}
enum PlayerState {

    CONNECTING, CHATTING, GAMING
}

enum MessageType {
    
    PING, SET_NAME, CHAT_MESSAGE, GAME_DATA, START_GAME
    
}